A database transaction is a sequence of SQL statements that a database system, such as an application server and a database, treats as a single group. A transaction moves a database from one consistent state to another. For a successful transaction, the database system performs a COMMIT, and all data changes that occurred during the transaction are retained in the database. For an unsuccessful transaction (e.g., an interruption), the database system performs a ROLLBACK, and reverts the database to its state before the transaction commenced by reversing all changes that occurred during the transaction.
Typically, when a Java Transactional Architecture (JTA) transaction times out or is otherwise unsuccessful, a Java Application Server will flag the transaction as a candidate for a rollback procedure, in order to preserve the consistency of the database fulfilling the transaction. However, the transaction may remain in a locked or long-running state, and cause or introduce problems associated with not completing database requests from applications, exhausting system resources, and other drawbacks.